import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/TaskMangeList'
        },
        {
            path: '/login',
            component: resolve => require(['../views/pages/Login.vue'], resolve)
        },
        {
            path: '/404',
            component: resolve => require(['../views/pages/404.vue'], resolve)
        },
        {
            path: '/403',
            component: resolve => require(['../views/pages/403.vue'], resolve)
        },
        {
            path: '*',
            redirect: '/404'
        },
        {
            path: '/main',
            component: resolve => require(['../views/common/Home.vue'], resolve),
            children:[
                {
                    path: '/AuditList',
                    component: resolve => require(['../views/pages/AuditList.vue'], resolve),
                    meta: { title: '任务审核列表', activeRouter: '/AuditList'}
                },
                {
                    path: '/TaskMangeList',
                    component: resolve => require(['../views/pages/TaskMangeList.vue'], resolve),
                    meta: { title: '任务管理列表', activeRouter: '/TaskMangeList'}
                },
                {
                    path: '/TaskReject',
                    component: resolve => require(['../views/pages/TaskReject.vue'], resolve),
                    meta: { title: '驳回任务', activeRouter: '/TaskReject'}
                },
                {
                    path: '/TaskRejectList',
                    component: resolve => require(['../views/pages/TaskRejectList.vue'], resolve),
                    meta: { title: '驳回任务列表', activeRouter: '/TaskRejectList'}
                },
                {
                    path: '/AuditModule',
                    component: resolve => require(['../views/pages/AuditModule.vue'], resolve),
                    meta: {title: '审核管',activeRouter: '/AuditList'}
                },{
                    path: '/AuditModules',
                    component: resolve => require(['../views/pages/AuditModules.vue'], resolve),
                    meta: {title: '审核管理',activeRouter: '/AuditLists'}
                },
                {
                    path: '/constant',
                    component: resolve => require(['../views/pages/ConstantManage.vue'], resolve),
                    meta: { title: '常量管理', activeRouter:'/constant' }
                },
                {
                    path: '/dataset',
                    component: resolve => require(['../views/pages/DataSet.vue'], resolve),
                    meta: { title: '选择数据集', activeRouter: '/dataset' }
                },
                {
                    path: '/settings',
                    component: resolve => require(['../views/pages/Settings.vue'], resolve),
                    meta: { title: '设置', activeRouter: '/settings' }
                },
                {
                    path: '/taskModule',
                    component: resolve => require(['../views/pages/TaskModule.vue'], resolve),
                    meta: {title: '任务管理', activeRouter: '/TaskMangeList'}
                },
                {
                    path: '/export',
                    component: resolve => require(['../views/pages/export.vue'], resolve),
                    meta: {title: '导出数据'}
                }
            ]
        },
        /*下面这些是例子，可以参考，也可以全部删掉*/
        {
            path: '/examples/',
            component: resolve => require(['../views/common/Home.vue'], resolve),
            meta: { title: '自述文件' },
            children:[
                {
                    path: '/dashboard',
                    component: resolve => require(['../views/pages/examples/Dashboard.vue'], resolve),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/table',
                    component: resolve => require(['../views/pages/examples/BaseTable.vue'], resolve),
                    meta: { title: '基础表格' }
                },
                {
                    path: '/tabs',
                    component: resolve => require(['../views/pages/examples/Tabs.vue'], resolve),
                    meta: { title: 'tab选项卡' }
                },
                {
                    path: '/form',
                    component: resolve => require(['../views/pages/examples/BaseForm.vue'], resolve),
                    meta: { title: '基本表单' }
                },
                {
                    // 富文本编辑器组件
                    path: '/editor',
                    component: resolve => require(['../views/pages/examples/VueEditor.vue'], resolve),
                    meta: { title: '富文本编辑器' }
                },
                {
                    // markdown组件
                    path: '/markdown',
                    component: resolve => require(['../views/pages/examples/Markdown.vue'], resolve),
                    meta: { title: 'markdown编辑器' }    
                },
                {
                    // 图片上传组件
                    path: '/upload',
                    component: resolve => require(['../views/pages/examples/Upload.vue'], resolve),
                    meta: { title: '文件上传' }   
                },
                {
                    // vue-schart组件
                    path: '/charts',
                    component: resolve => require(['../views/pages/examples/BaseCharts.vue'], resolve),
                    meta: { title: 'schart图表' }
                },
                {
                    // 拖拽列表组件
                    path: '/drag',
                    component: resolve => require(['../views/pages/examples/DragList.vue'], resolve),
                    meta: { title: '拖拽列表' }
                },
                {
                    // 权限页面
                    path: '/permission',
                    component: resolve => require(['../views/pages/examples/Permission.vue'], resolve),
                    meta: { title: '权限测试', permission: true }
                }
            ]
        },
    ]
})
